package com.ruoyi.carShop.service.impl;

import com.ruoyi.carShop.domain.RepairReservation;
import com.ruoyi.carShop.mapper.RepairReservationMapper;
import com.ruoyi.carShop.service.RepairReservationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Author:严瑞
 * @Date ：2024/9/14 15:17
 */
@Service
public class RepairReservationServiceImpl implements RepairReservationService {

    @Autowired
    private RepairReservationMapper repairReservationMapper;
    @Override
    public RepairReservation selectRepairReservationById(Long repairReservationId) {
        return repairReservationMapper.selectRepairReservationById(repairReservationId);
    }

    @Override
    public List<RepairReservation> selectRepairReservationList(RepairReservation repairReservation) {
        return repairReservationMapper.selectRepairReservationList(repairReservation);
    }

    @Override
    public int updateRepairReservation(RepairReservation repairReservation) {
        repairReservation.setArrivalTime(LocalDateTime.now());
        repairReservation.setStatus(2);
        return repairReservationMapper.updateRepairReservation(repairReservation);
    }
}
